
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package com.xxxy.jsq.action.rule;

import com.xxxy.jsq.dao.RuleDao;
import com.xxxy.jsq.model.Rule;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@WebServlet({"/deleteRuleServlet"})
public class deleteRuleServlet extends HttpServlet {
    private static final long serialVersionUID = 1L;

    public deleteRuleServlet() {
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        request.setCharacterEncoding("utf-8");
        response.setCharacterEncoding("utf-8");
        response.setContentType("text/html;charset=utf-8");
        new Rule();
        RuleDao dao = new RuleDao();
        Long ruleId = Long.valueOf(request.getParameter("cid"));
        String flag = dao.deleteById(ruleId);
        PrintWriter out = response.getWriter();
        out.print(flag);
        out.flush();
        out.close();
    }

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        this.doGet(request, response);
    }
}


